package designpattern.strategy.order;

import designpattern.strategy.order.domain.DiscountScheme;

import java.math.BigDecimal;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 刘牌
 * @Date: 2021/12/21/13:07
 * @Description: 方案折扣
 */
public class DiscountSchemeStrategy implements IOrderDiscountStrategy<DiscountScheme> {

    @Override
    public BigDecimal discount(DiscountScheme discountScheme , BigDecimal totalMoney) {

        return totalMoney.multiply(discountScheme.getDiscount());
    }
}
